<extend name="Category/index" />
<!doctype html>
<html lang="cn">
<head>
	<meta charset="UTF-8">
	<title>购买首页</title>
	<link rel="stylesheet" href="__PUBLIC__/css/bootstrap.min.css">
    <link rel="stylesheet" href="__PUBLIC__/home/css/buy/index.css">
    <link rel="stylesheet" href="__PUBLIC__/home/css/iconfont/iconfont.css">
    <script src="__PUBLIC__/jquery-1.8.3.min.js"></script>
</head>
<body>
<block name="main1">
 <link rel="stylesheet" href="__PUBLIC__/home/css/buy/index.css">
 <script src="__PUBLIC__/jquery-1.8.3.min.js"></script>
</block>
<block name="main">
	<div class="container">
		<h2 class="blk">排片购票</h2>
		<div class="row r">
			<div class="col-md-4 blk">电影院</div>
			<div class="col-md-8 r1">
				<div class="col-md-2 blk">开始时间</div>
				<div class="col-md-2 blk">结束时间</div>
				<div class="col-md-2 blk">放映厅</div>
				<div class="col-md-2 blk">票价</div>
				<div class="col-md-2 blk">票数</div>
				<div class="col-md-2 db"></div>
				
			</div>
		</div>
		<div class="row r2">
			<div class="col-md-4 r3 r7">
			<volist name="list" id="vo">
				<div class="col-md-12 r4" id="tk" class="dy" bz="<{$vo.id}>" bt="<{$id}>">
				<p><{$vo.name}></p>
				<p class="r5"><{$vo.address}></p>
				</div>
			</volist>
			</div>
			<div class="col-md-8 r3 r8">
				<div class="col-md-2 r6 t1"></div>
				<div class="col-md-2 t2"></div>
				<div class="col-md-2 t3"></div>
				<div class="col-md-2 t4"></div>
				<div class="col-md-2 t5"></div>
				<div class="col-md-2 t6"></div>
			</div>
		</div>
	</div>
	<input type="hidden" id="murl" value="__MODULE__">
	<script>
	$(function ()
	{
		//左边特效
		$('.r4').mouseover(function()
		{
			$(this).css('background-color','#f70');
			$(this).css('color','white');
		})
		$('.r4').mouseout(function()
		{
			$(this).css('background-color','white');
			$(this).css('color','black');
		})
		$('.r4').click(function ()
		{
			var id = $(this).attr('bz');
			var mid = $(this).attr('bt');
			// console.log(mid);
			$.ajax ({
				type:"get",
				url:"<{:U('Buy/index')}>",
				data:{cid:id,mid:mid},
				success:function (data)
				{
					// console.log(data);

						$('.t1').html('');
						$('.t2').html('');
						$('.t3').html('');
						$('.t4').html('');
						$('.t5').html('');
						$('.t6').html('');
						
					console.log(data);
					if (data=='') {
						$('.t1').html('暂无搜索内容...');
					} else {
					for (var i =0;i < data.length; i ++) {
						$('<input name="starttime" readonly>').val(data[i].starttime).appendTo ('.t1');
						$('<input name="endtime" readonly>').val(data[i].endtime).appendTo ('.t2');
						$('<input name="hall" readonly>').val(data[i].hall).appendTo ('.t3');
						$('<input name="price" readonly>').val(data[i].price).appendTo ('.t4');
						$('<input name="num" readonly>').val(data[i].num).appendTo ('.t5');
						$("<a class='btn btn-default' href='"+$('#murl').val()+"/Buy/buy?id="+data[i]['id']+"'>立即购买</a>").appendTo('.t6');

					}
				}
				},
				dateType:'json',
			})
			// window.location.href="Buy/info?cid="+id+"&mid="+mid;

		})
			$('#tk').click();
	})
</script>
<script src="__PUBLIC__/js/jquery.min.js"></script>
<script src="__PUBLIC__/js/bootstrap.min.js"></script>
</block>
</body>
</html>